package Box2D.Collision
{
	import Box2D.Common.Math.b2Vec2;
	import Box2D.Common.b2Wrapper;
	
	public class b2AABB extends b2Wrapper
	{
		private var _lowerBound:b2Vec2;
		private var _upperBound:b2Vec2;
		public function b2AABB(wrapper:Object=null)
		{
			if(wrapper==null)
				wrapper = callDirect('b2AABB_new'); 
			super(wrapper);
			_lowerBound = new b2Vec2(0,0,wrapper);
			_upperBound = new b2Vec2(0,0,wrapper+8);
		}
		public function get lowerBound():b2Vec2{return _lowerBound}
		public function set lowerBound(value:b2Vec2):void{_lowerBound.Copy(value)}
		
		public function get upperBound():b2Vec2{return _upperBound}		
		public function set upperBound(value:b2Vec2):void{_upperBound.Copy(value)}
		
		public function Copy(source:b2AABB):void{
			call('b2AABB_Copy',source.wrapper);
		}
		public function Clone():b2AABB{
			var result:b2AABB = new b2AABB;
			result.Copy(this);
			return result;
		}
		
		public function GetCenter():b2Vec2{
			return new b2Vec2(0,0,call('b2AABB_GetCenter'));
		}
		public function GetExtents():b2Vec2{
			return new b2Vec2(0,0,call('b2AABB_GetExtents'));
		}
		public function Combine(aabb1:b2AABB,aabb2:b2AABB):void{
			call('b2AABB_Combine',aabb1.wrapper,aabb2.wrapper);
		}
		public function Contains(aabb:b2AABB):Boolean{
			return call('b2AABB_Contains',aabb.wrapper);
		}
		public function RayCast(output:b2RayCastOutput,input:b2RayCastInput):Boolean{
			return call('b2AABB_RayCast',output.wrapper,input.wrapper);
		}
	}
}